home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-05 | 1.4 KB | 70 lines | [TEXT/MPS ] |
- /*
- File: mtb14.c
- Contains: Cover Proc Functions
- Written by: DTS and QT Engineering
- Copyright: © 1992-1994 by Apple Computer, Inc., all rights reserved.
- Change History (most recent first):
- <1> 12/4/94 khs changed the format of the file to the new look and feel
- To Do:
- */
-
-
- // INCLUDES
- #include "mtb.h"
-
-
- // FUNCTIONS
- pascal OSErr MyCoverProc(Movie aMovie,
- RgnHandle changedRgn,
- long refcon)
- {
- CGrafPtr mPort;
- GDHandle mGD;
-
- GetMovieGWorld(aMovie, &mPort, &mGD);
- DiffRgn(mPort->clipRgn, changedRgn, mPort->clipRgn);
- return noErr;
- }
-
-
- pascal OSErr MyUnCoverProc(Movie aMovie,
- RgnHandle changedRgn,
- long refcon)
- {
- CGrafPtr mPort, curPort;
- GDHandle mGD, curGD;
-
- GetMovieGWorld(aMovie, &mPort, &mGD);
- GetGWorld(&curPort, &curGD);
- SetGWorld(mPort, mGD);
-
- InvalRgn(changedRgn);
- UnionRgn(mPort->clipRgn, changedRgn, mPort->clipRgn);
-
- SetGWorld(curPort, curGD);
- return noErr;
- }
-
-
- void InitCoverProcs(WindowPtr aWindow,
- Movie aMovie)
- {
- RgnHandle displayBounds;
- GrafPtr curPort;
-
- displayBounds = GetMovieDisplayBoundsRgn(aMovie);
- if (displayBounds == nil)
- return;
-
- GetPort(&curPort);
- SetPort(aWindow);
- ClipRect(&aWindow->portRect);
- DiffRgn(aWindow->clipRgn, displayBounds, aWindow->clipRgn);
- DisposeRgn(displayBounds);
- SetPort(curPort);
-
- SetMovieCoverProcs(aMovie, &MyUnCoverProc, &MyCoverProc, 0);
- }
-
-
-